import request from '@/config/axios'

// 阶段-答辩时间安排 VO
export interface StageDebateTimeVO {
  id: string // 阶段-答辩时间安排ID
  instanceRuleId: string // 评奖阶段设置ID
  awardsId: string // 评奖ID
  breakTime: string // 休息时间
  gap: number // 面试间隔分钟
  debateStartTime: Date // 面试开始时间
  priority: string // 博士优先或硕士优先
  remark: string // 备注
}

// 阶段-答辩时间安排 API
export const StageDebateTimeApi = {
  // 查询阶段-答辩时间安排分页
  getStageDebateTimePage: async (params: any) => {
    return await request.get({ url: `/awards/stage-debate-time/page`, params })
  },

  // 查询阶段-答辩时间安排详情
  getStageDebateTime: async (id: string) => {
    return await request.get({ url: `/awards/stage-debate-time/get?id=` + id })
  },

  // 新增阶段-答辩时间安排
  createStageDebateTime: async (data: StageDebateTimeVO) => {
    return await request.post({ url: `/awards/stage-debate-time/create`, data })
  },

  // 修改阶段-答辩时间安排
  updateStageDebateTime: async (data: StageDebateTimeVO) => {
    return await request.put({ url: `/awards/stage-debate-time/update`, data })
  },

  // 删除阶段-答辩时间安排
  deleteStageDebateTime: async (id: string) => {
    return await request.delete({ url: `/awards/stage-debate-time/delete?id=` + id })
  },

  // 导出阶段-答辩时间安排 Excel
  exportStageDebateTime: async (params) => {
    return await request.download({ url: `/awards/stage-debate-time/export-excel`, params })
  },

  // 根据规则ID查询阶段-答辩时间安排详情
  getStageDebateTimeByRuleId: async (ruleId: string) => {
    return await request.get({ url: `/awards/stage-debate-time/get-by-rule?ruleId=${ruleId}` })
  }
}
